#ifndef __SERIAL_H
#define __SERIAL_H

#include <stdint.h>

#define SERIAL2_RX_BUFFER_SIZE 512

extern volatile uint8_t Serial2_RxBuffer[SERIAL2_RX_BUFFER_SIZE];
extern volatile uint16_t Serial2_RxIndex;
extern volatile uint8_t Serial2_RxFlag;

void Serial2_Init(void);
void Serial2_SendByte(uint8_t Byte);
void Serial2_SendArray(uint8_t *Array, uint16_t Length);
void Serial2_SendString(char *String);
uint16_t Serial2_GetRxData(uint8_t *buffer, uint16_t max_length);
uint8_t Serial2_DataAvailable(void);
void Serial2_ClearRxBuffer(void);
uint16_t Serial2_GetRxDataLength(void);

#endif /* __SERIAL_H */
